/**
 * 
 */
package com.nikolvas.interpolation;

/**
 * @author vnikolenko
 *
 */
public class LinearFunction implements IFunction {

	private final float k;
	private final float b;
	
	public LinearFunction(float k, float b){
		this.k = k;
		this.b = b;
	}
		
	/**
	 * @return the k
	 */
	public float getK() {
		return k;
	}

	/**
	 * @return the b
	 */
	public float getB() {
		return b;
	}


	/* (non-Javadoc)
	 * @see com.nikolvas.interpolation.IFunction#getY(double)
	 */
	@Override
	public float getY(float x) {		
		return k * x + b;
	}

}
